package com.vast.ui.component.providers;

import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

import com.vast.ui.component.models.Item;
import com.vast.ui.component.models.ItemArray;
import com.vast.ui.panel.iopanel.Activator;



public class IoLabelProvider extends LabelProvider implements
ITableLabelProvider {
	private Display display;
	private Image on = Activator.getDefault().getImageRegistry().getDescriptor("ON").createImage();
	private Image off = Activator.getDefault().getImageRegistry().getDescriptor("OFF").createImage();
	
	public IoLabelProvider(Display display) {
		this.display  = display;
	}
	
	public Image getColumnImage(Object element, int columnIndex) {
		if(columnIndex == 0) {
			return null;
		}
		ItemArray itemArray = (ItemArray) element;
		Item      item      = itemArray.getItem(columnIndex - 1);
		return item.isChecked()? on : off;
	}

	public String getColumnText(Object element, int columnIndex) {
		// TODO Auto-generated method stub
		return null;
		//return result = io.isChecked(columnIndex) ? "ON" : "OFF";
		//return null;
	}

}
